$(document).ready( function () {
    $('#eventlog_table').DataTable( {
    "order": [[ 3, "desc" ]]
    });
    $('#port_table').DataTable( {
        columnDefs: [ {
            orderable: false,
            className: 'dt-center',
            targets:   0
        } ],
        select: {
            style:   'multi',
            selector: 'td:first-child',
        },
        order: [[ 1, 'asc' ]]
    });
    $('#ipeventlog_table').DataTable( {
       "order": [[ 3, "desc" ]]
    } );
    $('#ipaddress_table').DataTable( {
       "order": [[ 0, "asc" ]]
    });
    $('#cabinet_table').DataTable( {
       "order": [[ 0, "asc" ]]
    });
    $('#asset_table').DataTable( {
       "order": [[ 0, "desc" ]]
    });
//服务器
    $('#server_table').DataTable( {
        dom: 'lBfrtip',
        buttons: [
        {
            extend: 'excel',
            text: '导出当前页',
            exportOptions: {
                columns: ':visible',
                modifier: { page: 'current' }
            }
        },
        {
            extend: 'excel',
            text: '导出所有',
            exportOptions: {
                columns: ':visible',
            }
        }
        ],
    "columnDefs": [
        { "targets": [ 6,7,10,12,14 ],
          "visible": false,
         },
    ]
    });
//网络设备管理
    $('#networkdevice_table').DataTable( {
        dom: 'lBfrtip',
        buttons: [
        {
            extend: 'excel',
            text: '导出当前页',
            exportOptions: {
                columns: ':visible',
                modifier: {
                    page: 'current'
                }
            }
        },
        {
            extend: 'excel',
            text: '导出所有',
            exportOptions: {
                columns: ':visible',
            }
        }
    ],
    "columnDefs": [
       { "targets": [ 3,7,8,11,13,15 ],
         "visible": false, },
    ]
    });
//专线管理
    $('#circuits_table').DataTable( {
        dom: 'lBfrtip',
        buttons: [
        {
            extend: 'excel',
            text: '导出当前页',
            exportOptions: {
                columns: ':visible',
                modifier: {
                    page: 'current'
                }
            }
        },
        {
            extend: 'excel',
            text: '导出所有',
            exportOptions: {
                columns: ':visible',
            }
        }
    ],
    "columnDefs": [
    {
    "targets": [ 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26 ],
    "visible": false
    }
    ]
    } );
//IP网段、IP地址、机房、机架
    $('#assets_table').DataTable( {
        dom: 'lBfrtip',
        buttons: [
        {
            extend: 'excel',
            text: '导出当前页',
            exportOptions: {
                modifier: { page: 'current' }
            }
        },
        {
            extend: 'excel',
            text: '导出所有',
        }
        ]
    });
//DWDM
    $('#dwdm_table').DataTable( {
        dom: 'lBfrtip',
        buttons: [
        {
            extend: 'excel',
            text: '导出当前页',
            exportOptions: {
                columns: ':visible',
                modifier: {
                    page: 'current'
                }
            }
        },
        {
            extend: 'excel',
            text: '导出所有',
            exportOptions: {
                columns: ':visible',
            }
        }
    ],
    "columnDefs": [
    {
    "targets": [ 3,6,7,8,9,10,11,12,13,14,15,16,17,18,19 ],
    "visible": false
    }
    ]
    } );
//波道
    $('#channel_table').DataTable( {
        dom: 'lBfrtip',
        buttons: [
        {
            extend: 'excel',
            text: '导出当前页',
            exportOptions: {
                columns: ':visible',
                modifier: {
                    page: 'current'
                }
            }
        },
        {
            extend: 'excel',
            text: '导出所有',
            exportOptions: {
                columns: ':visible',
            }
        }
    ],
    "columnDefs": [
    {
    "targets": [ 8 ],
    "visible": false
    }
    ]
    } );
//DWDM下波道
    $('#dwdm_channel_table').DataTable( {
       "order": [[ 0, "asc" ]]
    });
});
